<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.henu.col05023.common.CommonUtil"%>
<%@ page import="com.henu.col05023.common.data.Student;"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	String result=CommonUtil.nvlToString(request.getAttribute("result"));
	
	Student student = (Student)request.getSession().getAttribute("student");
%>
<html>
	<head>
		<title>个人信息修改</title>
		<LINK href="<%=path%>/common/css/admin.css" type="text/css"
			rel="stylesheet">
		<script type="text/javascript">
			var EventUtil = {
				addHandler:function(element,type,handler,bPhase){
					if(element.addEventListener){
						element.addEventListener(type,handler,bPhase||false);
					}else if(element.attachEvent){
						element.attachEvent("on"+type,handler);
					}else{
						element["on"+type] = handler;
					}
				},
				getEvent:function(event){
					return event?event:window.event;
				},
				getTarget:function(event){
					return event.target?event.target:event.srcElement;
				}
			}
			//鼠标事件
			var keyDownHandler = function(event){
				var ev = EventUtil.getEvent(event);
				if(ev.keyCode>=37 && ev.keyCode<=40){
					return ;
				}
				var obj = EventUtil.getTarget(ev);
				obj.value=obj.value.replace(/[^ -~]/g,'')
			}
			function init(){
				var phoneNo = document.getElementById("phoneNo");
				EventUtil.addHandler(phoneNo,'keyup',keyDownHandler);
				
				var phoneNo2 = document.getElementById("phoneNo2");
				EventUtil.addHandler(phoneNo2,'keyup',keyDownHandler);
				
				var qq = document.getElementById("qq");
				EventUtil.addHandler(qq,'keyup',keyDownHandler);
				
				var email = document.getElementById("email");
				EventUtil.addHandler(email,'keyup',keyDownHandler);
				
			}
		
			function resetAtten(obj){
				var atten=document.getElementById("attention");
				atten.innerText = "";
			}
			
			function doSave(obj){
				var obj_form=document.getElementById("_form");
				obj.disabled=true;
				obj_form.submit();
			}
			
			function deleteChinaCode(obj){
				var e = EventUtil.getEvent(event);
				alert(e);
				obj.value=obj.value.replace(/[^ -~]/g,'');
			}
			
		</script>
	</head>
	<body style="text-align: center;" onload="init()"  scroll="no">
		<div id="nav">
			<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
				<TR height=28>
					<TD class="td1">
						当前位置: 个人信息 > 个人信息
					</TD>
				</TR>
				<TR>
					<TD class="td2"></TD>
				</TR>
				<TR height=5>
					<TD class="td3"></TD>
				</TR>
			</TABLE>
		</div>
		<div class="formDiv">
			<table border="0" cellpadding="0" cellspacing="0" class="formTable">
				<!-- 表格标题行-->
				<tr class="tableTitleTR2">
					<td colspan="3">
						<table width="100%" border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td class="tableTitleLeft2">
									<span></span>
								</td>
								<td class="tableTitle2">
									个人信息修改
								</td>
								<td class="tableTitleRight2">
									&#160;
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td class="formTableL">
					</td>
					<td class="formTableC">
						<form id="_form" name="_form"
							action="<%=path%>/admin.do?method=updateInfo" method="post"
							target="_self">
							<div id="attention" name="attention" style="color:red;text-align:center;padding-top:5px;margin-bottom:-5px;"><%=result %></div>
							<table align="center" border="0" cellpadding="0" cellspacing="2"
								class="formTableCore">
								<tr>
									<td class="formLabel" nowrap style="text-align:right;width:50%;padding-right:10px;">
										学 号
									</td>
									<td class="formField" nowrap>
										<input type="text" name="studentNo" id="studentNo" value="<%=student.getStudentNo() %>" readonly/>
									</td>
								</tr>
								<tr>
									<td class="formLabel" nowrap style="text-align:right;width:50%;padding-right:10px;">
										姓 名
									</td>
									<td class="formField" nowrap>
										<input type="text" name="studentName" id="studentName" value="<%=student.getName() %>" maxlength="30" onfocus="resetAtten(this);"/>
									</td>
								</tr>
								<tr>
									<td class="formLabel" nowrap style="text-align:right;width:50%;padding-right:10px;">
										电 话
									</td>
									<td class="formField" nowrap>
										<input type="text" name="phoneNo" id="phoneNo" value="<%=student.getPhoneNo() %>" 
											style="ime-mode:disabled" maxlength="32" onfocus="resetAtten(this);" />
									</td>
								</tr>
								<tr>
									<td class="formLabel" nowrap style="text-align:right;width:50%;padding-right:10px;">
										电 话2
									</td>
									<td class="formField" nowrap>
										<input type="text" name="phoneNo2" id="phoneNo2" value="<%=student.getPhoneNo2() %>" 
										style="ime-mode:disabled" maxlength="32" onfocus="resetAtten(this);"/>
									</td>
								</tr>
								<tr>
									<td class="formLabel" nowrap style="text-align:right;width:50%;padding-right:10px;">
										QQ
									</td>
									<td class="formField" nowrap>
										<input type="text" name="qq" id="qq" value="<%=student.getQq() %>" 
										style="ime-mode:disabled" maxlength="32" onfocus="resetAtten(this);"/>
									</td>
								</tr>
								<tr>
									<td class="formLabel" nowrap style="text-align:right;width:50%;padding-right:10px;">
										Email
									</td>
									<td class="formField" nowrap>
										<input type="text" name="email" id="email" value="<%=student.getEmail() %>" 
										style="ime-mode:disabled" maxlength="128" onfocus="resetAtten(this);"/>
									</td>
								</tr>
								<tr>
									<td class="formLabel" nowrap style="text-align:right;width:50%;padding-right:10px;">
										公 司
									</td>
									<td class="formField" nowrap>
										<input type="text" name="company" id="company" value="<%=student.getCompany() %>" maxlength="128" onfocus="resetAtten(this);"/>
									</td>
								</tr>
								<tr>
									<td class="formLabel" nowrap style="text-align:right;width:50%;padding-right:10px;">
										地 址
									</td>
									<td class="formField" nowrap>
										<input type="text" name="address" id="address" value="<%=student.getAddress() %>" maxlength="128" onfocus="resetAtten(this);"/>
									</td>
								</tr>
							</table>
						</form>
						<div class="button">
							<a href="javascript:viod(0)" onclick="doSave(this);return false;"><span
								class="span" id="save_button" name="save_button"></span><span class="text">保 存</span> </a>
						</div>
					</td>
					<td class="formTableR">
					</td>
				</tr>
				<tr>
					<td class="formTableLB">
					</td>
					<td class="formTableB">
					</td>
					<td class="formTableRB">
					</td>
				</tr>
			</table>
		</div>
	</body>
</html>
